<?php

namespace App\Http\Controllers;

use App\Messages;
use Illuminate\Http\Request;
use MercurySeries\Flashy\Flashy;

class MessagesController extends Controller
{
    public function show()
    {
        $messages = Messages::all();
        return view('messages.show' ,compact('messages'));
    }

    public function delete(Messages $msg ,Request $request)
    {
        $msg->delete();

        Flashy::success('操作成功');

        return redirect()->back();
    }
}
